package com.itheima.多态.多态的好处_04;

//动物类  -- 父类
public abstract class Animal {
    public abstract void eat();
}

class Dog extends Animal{
    @Override
    public void eat() {
        System.out.println("狗吃肉!");
    }
}
class Cat extends Animal{
    @Override
    public void eat() {
        System.out.println("猫吃鱼!");
    }
}
class Pig extends Animal{
    @Override
    public void eat() {
        System.out.println("猪吃白菜!");
    }
}
class Monkey extends Animal{
    @Override
    public void eat() {
        System.out.println("猴吃桃!");
    }
}